
import request from '@/utils/request'
const url_ax = 'system/push/'


// 发布推送通知给所有人
export function pushMessageAllUser(data) {
  return httpf('pushMessageAllUser','get',data);
}
// 发布推送通知给所有人，带json字符串参数
export function pushMessageAllUserForJson(data) {
  return httpf('pushMessageAllUserForJson','post',data);
}

// 发布推送通知给指定一组用户
export function pushMessageToUsers(data) {
  return httpf('pushMessageToUsers','get',data);
}
// 发布推送通知给指定一组用户，带json字符串参数
export function pushMessageToUsersForJson(data) {
  return httpf('pushMessageToUsersForJson','post',data);
}


function httpf(url,mh,data) {
  if(mh == 'get'){
    return request({
      url: url_ax+url,
      method: 'post',
      data: data
    })
  }else {
    return request({
      url: url_ax+url,
      method: 'post',
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      },
      data: data
    })
  }
}
